package org.yookiee.support.toolkits;

import com.google.common.base.Strings;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * FileName RegUtils
 * Package org.yookiee.support.toolkits
 * Description regex tool
 * author cpstory
 * create 2023-10-06 9:44
 * version V1.0
 */
public class RegToolkit {

    public static boolean verifyRule(String target,String regRule){
        if(Strings.isNullOrEmpty(target) || Strings.isNullOrEmpty(regRule)){
            return false;
        }
        Pattern pattern = Pattern.compile(regRule);
        Matcher matcher = pattern.matcher(target);
        return matcher.matches();
    }


}
